package com.klun.project.common.constans.leetcode;


import java.util.TreeMap;

public class Solution9 {
	public boolean isPalindrome(int x) {
		if (x <= 0 || x / 10 == 0) {
			return false;
		}
		int temp = 0;
		while (temp < x) {
			temp = temp * 10 + x % 10;
			x = x / 10;
			System.out.println(temp);
		}
		return temp == x || temp / 10 == x;
	}

	public static void main(String[] args) {
		Solution9 solution9 = new Solution9();
		System.out.println(solution9.isPalindrome(-121));
		System.out.println(solution9.isPalindrome(123454321));
		TreeMap tm = new TreeMap();
	}

}
